<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>admin</title>
<link href="<?php echo ADMIN_THEME?>images/reset.css" rel="stylesheet" type="text/css" />
<link href="<?php echo ADMIN_THEME?>images/system.css" rel="stylesheet" type="text/css" />
<link href="<?php echo ADMIN_THEME?>images/main.css" rel="stylesheet" type="text/css" />
<link href="<?php echo ADMIN_THEME?>images/table_form.css" rel="stylesheet" type="text/css" />
<link href="<?php echo ADMIN_THEME?>images/dialog.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<?php echo ADMIN_THEME?>js/jquery.min.js"></script>
<script language="javascript" src="<?php echo ADMIN_THEME?>js/dialog.js"></script>
</head>
<body>
<div class="subnav">
<div class="content-menu ib-a blue line-x">
<?php
$a = isset($_GET['a']) && $_GET['a'] ? $_GET['a'] : 'index';
foreach ($menu as $i=>$t) {
	$class = $a == $t[0] ? ' class="on"' : '';
	$span  = $i >= count($menu)-1  ? '' : '<span>|</span>';
	echo '<a href="' . purl('admin/' . $t[0]) . '" ' . $class . '><em>' . $t[1] . '</em></a>' . $span;
}
?>
<span>|</span><a href="<?php echo purl('index/list');?>" target="_blank"><em>前台浏览</em></a>
</div>
<div class="bk10"></div>
<div class="table-list">
	<form method="post" action="" id="myform" name="myform">
		<div class="contentList">
		<table width="100%" class="table_form">
		<tr>
			<th width="240">淘宝账号： </th>
			<td><input class="input-text" type="text" name="username" value="<?php echo $data['username']?>" size="30"/></td>
		</tr>
		<tr>
			<th>开放平台： </th>
			<td>
		<table>
		<?php if (!empty($data['appusers'])) {
		foreach($data['appusers'] as $k=>$t) {
		?>
		<tr>
		<td width="200">App Key：<input class="input-text" type="text" name="users[a][<?php echo $k?>]" value="<?php echo $t['a']?>" size="15"/></td>
		<td>App Secret：<input class="input-text" type="text" name="users[s][<?php echo $k?>]" value="<?php echo $t['s']?>" size="50"/></td>
		<td><a href="javascript:add_menu();">添加</a></td>
		</tr>
		<?php } } else { ?>
		<tr>
		<td width="200">App Key：<input class="input-text" type="text" name="users[a][]" value="" size="15"/></td>
		<td>App Secret：<input class="input-text" type="text" name="users[s][]" value="" size="50"/></td>
		<td><a href="javascript:add_menu();">添加</a></td>
		</tr>
		<?php } ?>
		<tbody id="menu_body">
		</tbody>
		</table>
			</td>
		</tr>
		<tr>
			<th>数据缓存时间： </th>
			<td><input class="input-text" type="text" name="cachetime" value="<?php echo $data['cachetime']?>" size="10"/> 小时</td>
		</tr>
		<tr>
			<th>是否显示错误： </th>
			<td>
			<input name="error" type="radio" value="1" <?php if ($data['error']==1) echo "checked";?>> 显示 
			&nbsp;&nbsp;&nbsp;
			<input name="error" type="radio" value="0" <?php if ($data['error']==0) echo "checked";?>> 不显示
			</td>
		</tr>
		<tr>
			<th>列表模板页： </th>
			<td><input class="input-text" type="text" name="listtpl" value="<?php echo $data['listtpl'] ? $data['listtpl'] : 'list_taobao.html';?>" size="30"/> 格式.html</td>
		</tr>
		<tr>
			<th>内容模板页： </th>
			<td><input class="input-text" type="text" name="showtpl" value="<?php echo $data['showtpl'] ? $data['showtpl'] : 'show_taobao.html';?>" size="30"/> 格式.html</td>
		</tr>
		<tr>
			<th>&nbsp;</th>
			<td><input type="submit" class="button" value="提交" name="submit"></td>
		</tr>
		</table>
		</div>
	</form>
</div>
</div>
</body>
</html>
<script language="javascript">
function add_menu() {
    var data = '<tr><td width="200">App Key：<input class="input-text" type="text" name="users[a][]" value="" size="15"/></td><td>App Secret：<input class="input-text" type="text" name="users[s][]" size="50"/></td><td>&nbsp;</td></tr>';
	$('#menu_body').append(data);
}
</script>